<%--
  Created by IntelliJ IDEA.
  User: 徐志杰大王
  Date: 2023/9/6
  Time: 22:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath }"/>
<html>
<head>
    <title>修改影院</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <script src="js/jquery.js"></script>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/index.css">
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/index.js"></script>
    <STYLE>
        #addImg{
            border: 1px;
            width: 150px;
            height: 50px;
            position: relative;
            left: 60px;
            top: 30px;
            color: #5b5b5b;
            background-color: #e6e6e6;
            border-radius: 10px;
        }
    </STYLE>
</head>
<body>
<c:set var="cim" value="${sessionScope.cim}"/>
<div class="layui-card">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

        <div class="layui-tab-content" >
            <div class="layui-tab-item layui-show">
                <form class="layui-form layui-form-pane" enctype="multipart/form-data" method="post" action="${path}/updateCineServlet?prom=updateCine&cinema_id=${cim.cinema_id}">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="height: 100px;padding: 0px">
                            <img id="moviePirture" src="${path}/images/cinemaPicture/${cim.cinema_img}" width="110px" height="110px" >
                        </label>
                        <div class="layui-input-block" style="height: 100px">
                            <input type="button" style="z-index: 1" value="添加图片" id="addImg">
                            <input id="file" type="file" name="cinema_img" autocomplete="off" placeholder=" "
                                   class="layui-input" lay-verify="required" style="height: 80px;width: 250px;position: relative; bottom: 40px;z-index: 2;opacity: 0">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>影院名称
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="cinema_name" autocomplete="off" placeholder="" id="cinema_name"
                                   class="layui-input" lay-verify="required" value="${cim.cinema_name}">
                        </div>
                    </div>
                        <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>影院地址
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="cinema_address" autocomplete="off" placeholder="" id="cinema_address"
                                   class="layui-input" lay-verify="number" value="${cim.cinema_address}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>影院号码
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="cinema_phone" autocomplete="off" placeholder="" id="cinema_phone"
                                   class="layui-input" lay-verify="number" value="${cim.cinema_phone}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>影院评分
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="cinema_score" autocomplete="off" placeholder="" id="cinema_score"
                                   class="layui-input" lay-verify="number" value="${cim.cinema_score}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" lay-submit="" lay-filter="*" type="submit" style="position: absolute;left: 330px">
                            添加
                        </button>
                    </div>
                </form>
                <div style="height:100px;"></div>
            </div>

        </div>
    </div>
</div>
<script>
    $("#file").change(function(){
        var url=document.getElementById('file').files[0].name;
        $("#moviePirture").attr("src","${path}/images/cinemaPicture/"+url);
        //获取文件全部路径
        var urlPath=document.getElementById('file').value;
    })
</script>
</body>
</html>
